/**
 * <copyright>
 * </copyright>
 *
 */
package org.soaism.soadsl.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.soaism.soadsl.BodyMessage;
import org.soaism.soadsl.PostRequest;
import org.soaism.soadsl.SoadslPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Post Request</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.soaism.soadsl.impl.PostRequestImpl#getBodyMsg <em>Body Msg</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class PostRequestImpl extends RestServiceRequestImpl implements PostRequest
{
  /**
   * The cached value of the '{@link #getBodyMsg() <em>Body Msg</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getBodyMsg()
   * @generated
   * @ordered
   */
  protected BodyMessage bodyMsg;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected PostRequestImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return SoadslPackage.Literals.POST_REQUEST;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public BodyMessage getBodyMsg()
  {
    if (bodyMsg != null && bodyMsg.eIsProxy())
    {
      InternalEObject oldBodyMsg = (InternalEObject)bodyMsg;
      bodyMsg = (BodyMessage)eResolveProxy(oldBodyMsg);
      if (bodyMsg != oldBodyMsg)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, SoadslPackage.POST_REQUEST__BODY_MSG, oldBodyMsg, bodyMsg));
      }
    }
    return bodyMsg;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public BodyMessage basicGetBodyMsg()
  {
    return bodyMsg;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setBodyMsg(BodyMessage newBodyMsg)
  {
    BodyMessage oldBodyMsg = bodyMsg;
    bodyMsg = newBodyMsg;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, SoadslPackage.POST_REQUEST__BODY_MSG, oldBodyMsg, bodyMsg));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case SoadslPackage.POST_REQUEST__BODY_MSG:
        if (resolve) return getBodyMsg();
        return basicGetBodyMsg();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case SoadslPackage.POST_REQUEST__BODY_MSG:
        setBodyMsg((BodyMessage)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case SoadslPackage.POST_REQUEST__BODY_MSG:
        setBodyMsg((BodyMessage)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case SoadslPackage.POST_REQUEST__BODY_MSG:
        return bodyMsg != null;
    }
    return super.eIsSet(featureID);
  }

} //PostRequestImpl
